import { defineStore } from 'pinia'

export const useAccount = defineStore('account', {
  state: () => ({
    userinfo: null,
    permissionList: [],
  }),
  actions: {
    // 清除用户信息
    clearUserinfo() {
      this.userinfo = null
    },
    // 获取用户信息
    async getUserinfo() {
      this.userinfo = {
        name: 'admin',
        id: '1',
      }
      return Promise.resolve(this.userinfo)
    },
  },
})
